package com.qfedu.lc.server.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 4.用户成长值表
 * </p>
 *
 * @author wgz
 * @since 2023-11-06
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class UserLevel implements Serializable {

    private static final long serialVersionUID=1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 用户表id
     */
    private Integer userId;

    /**
     * 等级
     */
    private Integer level;

    /**
     * 等级称号
     */
    private String name;

    /**
     * 当前成长值
     */
    private Integer growths;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") //响应 1.当处理器方法返回对象时，将java.utils.Date 转化为对应的字符串 2023-08-31
    //接收   2.如果前端提交的json字符串 使用java对象接收    字符串2023-08-31 转化为java.utils.Date类型
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") // 将前端提交的键值对的时间字符串2023-08-31 转化为java.utils.Date类型
    private Date ctime;


    public UserLevel() {
    }

    public UserLevel(Integer uid, int level, String name, Integer growth, Date ctime) {

        this.userId = uid;
        this.level = level;
        this.name = name;
        this.growths = growth;
        this.ctime = ctime;
    }
}
